<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>360导航</title>
<style>
body {
    margin: 0;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 25%;
    background-color: #f1f1f1;
    position: fixed;
    height: 100%;
    overflow: auto;
}

li a {
    display: block;
    color: #000;
    padding: 8px 16px;
    text-decoration: none;
}

li a.active {
    background-color: #4CAF50;
    color: white;
}

li a:hover:not(.active) {
    background-color: #555;
    color: white;
}
    .dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  padding: 12px 16px;
}
.dropdown:hover .dropdown-content {
  display: block;
}
</style>
    <!--<script type="text/javascript">-->
    <!--function displayOrHide1(){-->
<!--var List1=document.getElementById("list1");-->
<!--if(hide){-->
  <!--//显示-->
  <!--List1.style.display="block";-->
  <!--hide=false;-->
<!--}else{-->
  <!--//隐藏-->
   <!--List1.style.display="none";-->
  <!--hide=true;-->
<!--}-->
<!--}-->
    <!--function displayOrHide2(){-->
<!--var List2=document.getElementById("list2");-->
<!--if(hide){-->
  <!--//显示-->
  <!--List2.style.display="block";-->
  <!--hide=false;-->
<!--}else{-->
  <!--//隐藏-->
   <!--List2.style.display="none";-->
  <!--hide=true;-->
<!--}-->
<!--}-->
<!--</script>-->
</head>
<body>
<p>尝试了js，没有实现</p>
<div id="wrapper">
    <ul class="menu">
        <li class="dropdown" id="one"><a class="active" href="#two">一级目录</a>
            <ul class="dropdown-content">
                <li class="subitem1"><a href="#">二级目录</a></li>
                <li class="subitem2"><a href="#">二级目录</a></li>
            </ul>
        </li><br>
        <li class="dropdown" id="two"><a class="active" href="#two">一级目录</a>
            <ul class="dropdown-content">
                <li class="subitem1"><a href="#">二级目录</a></li>
                <li class="subitem2"><a href="#">二级目录</a></li>
            </ul>
        </li>
    </ul>
</div>
</body>
</html>